import api from './index'

export interface ChatRequest {
  message: string
  context?: any
}

export interface ChatResponse {
  response: string
}

export interface CodeReviewRequest {
  code: string
  language?: string
  user_level?: string
}

export interface LearningGuideRequest {
  topic: string
  user_level?: string
}

export const assistantApi = {
  // 智能对话
  chat(data: ChatRequest): Promise<ChatResponse> {
    return api.post('/assistant/chat', data)
  },

  // 代码审查
  codeReview(data: CodeReviewRequest): Promise<any> {
    return api.post('/assistant/code-review', data)
  },

  // 学习指导
  learningGuide(data: LearningGuideRequest): Promise<any> {
    return api.post('/assistant/learning-guide', data)
  }
}
